
This folder contains the data and code to replicate the main and appendix analyses and figures in the paper "The Global Politics of Scientific Consensus: Evidence from the Intergovernmental Panel on Climate Change"


#--- R Packages Required
The replication requires the following versions of the R packges:
- tidyverse (version 2.0.0)
- rstan (version 2.32.6)
- countrycode (version 1.6.0)
- fixest (version 0.12.1)
- marginaleffects (version 0.22.0)
- bayesplot (version 1.11.1.9000)
- modelsummary (version 2.2.0)
- caret (version 7.0.1)

#--- Data Files
- ar5ar6intervention_country.csv: country-intervention level dataset required to estimate ideal points
- ar5ar6statement_dyad.csv: dyad-statement level dataset
- ar5ar6statement_level.csv: statement level dataset
- covariates.csv: country-level covariates


#--- Code Files
- 01_ideal_points.R: code to estimate ideal points
    - this outputs the ideal points for each country using ar5ar6intervention_country.csv 
    - Outputs fitted stan output (stan.fit.RData) and ideal points by country (idealpts.csv)
    - Also outputs, iso_names.RData which is used to identify countries in the ideal point outputs
    - NOTE: this code takes a long time to run (approximately 7 hours on a 6 core MacbookPro)

- 02_results.R: code for all main and appendix analysis tables and figures 
    - this code reads in the ideal points, dyad-statement level data, statement level data, and covariates
    - It then provides code for all main and appendix analysis tables and figures
    

